<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>缩放-scale</title>
    <style>
      body,
      ul {
        margin: 0;
        padding: 0;
      }

      body {
        background-image: url(../../images/grid.png);
      }
      svg {
        background-color: rgba(255, 0, 0, 0.1);
      }
    </style>
  </head>
  <body>
    <svg width="300" height="300" xmlns="http://www.w3.org/2000/svg">
      <!-- 1. 缩放一个元素 -->
      <rect
        transform="translate(100, 100) scale(1, 2)"
        x="0"
        y="0"
        width="100"
        height="50"
      ></rect>

      <!-- 2. 修改缩放的原点 -->
      <rect
        transform="translate(100, 100) scale(2)"
        x="-25"
        y="-25"
        width="50"
        height="50"
        fill="red"
      ></rect>

      <!-- 3. 修改缩放的原点 -->
      <g transform="scale(2)">
        <rect
          transform="translate(10, 0)"
          x="0"
          y="0"
          width="50"
          height="50"
          fill="blue"
        ></rect>
      </g>
    </svg>
  </body>
</html>
